class Person{
  name:string
  age:number
  constructor(name:string,age:number){
    this.name=name
    this.age=age
  }
  sayHi(str:string){
    console.log('hi,'+str)
  }
}

const p1=new Person('张三',18)
p1.sayHi('张三')